#include <iostream>
#include "AuClient.h"
#include "Request.h"
#include "Response.h"
#include "JsonUtil.h"
#include "FileUtil.h"
using namespace std;

int main(int argc, char const *argv[])
{
    map<string,string> paramMap;
    paramMap["type"]="1";
    paramMap["path"]="./1.png";
    //实例化Request请求对象
    Request request("192.168.38.128",8080,paramMap);
    //实例化AuClient对象
    AuClient client;
    //调用execute来向服务端发送请求
    Response *response=client.execute(request);
    if (response->getSuccess())
    {
        FileContent *fileContent=response->getFileContent();
        writeFile((char*)"./start.png",fileContent->content,fileContent->length);
    }else
    {
        cout<<"更新失败"<<endl;
    }
    
    
    return 0;
}
